package com.boot.ch7.controller;

import com.boot.ch7.annotation.CustomInterceptor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import lombok.extern.slf4j.Slf4j;

/**
 * @author onlyone
 */
@Slf4j
@RestController
@RequestMapping("/ch7")
public class Ch7Controller {

    @PostMapping("/save_user")
    @CustomInterceptor
    public String saveUser(@RequestParam(required = false) String username) {
        return "username=" + username + " , user创建成功！";
    }
}
